<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- saved from url=(0014)about:internet -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>藏边旅行网_图片垂直居中IE7</title>
<script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
<style>
	*{margin:0;padding:0;}
	body{
		font-family:"Verdana","宋体";
		font-size:12px;
	}
	.wrap{
		width:1000px;
		margin:0 auto;	
	}
	.box{
		width:400px;
		height:200px;
		background-color:#e0ffff;
		border: 1px #46dca2 solid;
		text-align: center; 
		display: table;
	}
	.wrapA{
		*height:100%;
		display: table-cell;
		*display:inline;
		writing-mode:tb-rl;
		vertical-align: middle;
	}
	.wrapA img{
		vertical-align: middle;
	}
</style>
</head>
<body>
	<div class="wrap">
		<div class="box">	
			<a class="wrapA" href="javascript:calc();">
				<img src="../../images/gray.png"></img>
			</a>		

		</div>
	</div>

	
<script type="text/javascript" >
	function calc(){
		var w = 399;
		var n = 5;
		var width = (w+1)/n - 1;
		var firstWidth = parseInt(width);
		var lastWidth = w - (n-1) - firstWidth * (n-1);
		alert(width + " " + parseInt(width) + " " + lastWidth);
	}
</script>

</body>
</html>